<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>银行管理后台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }

        body {
            background-color: #f5f7fa;
            color: #333;
            overflow-x: hidden;
        }

        .app-container {
            display: flex;
            min-height: 100vh;
            width: 100%;
        }

        .sidebar {
            width: 250px;
            background: linear-gradient(to bottom, #1a3a6c, #2c5a8d);
            color: #fff;
            padding: 30px 0;
            flex-shrink: 0;
            box-shadow: 0 0 15px rgba(0,0,0,0.2);
        }

        .logo-container {
            padding: 0 25px 25px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            margin-bottom: 20px;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .logo-icon {
            width: 50px;
            height: 50px;
            background-color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: #1a3a6c;
            font-weight: bold;
        }

        .logo-text {
            font-size: 20px;
            font-weight: 600;
        }

        .user-info {
            display: flex;
            align-items: center;
            padding: 20px 25px;
            gap: 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            margin-bottom: 20px;
        }

        .avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: #ffcc00;
            color: #1a3a6c;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 20px;
        }

        .user-details {
            flex: 1;
        }

        .user-name {
            font-weight: 600;
            margin-bottom: 5px;
            font-size: 16px;
        }

        .user-role {
            font-size: 13px;
            opacity: 0.8;
        }

        .sidebar-menu {
            padding: 0 15px;
            overflow-y: auto;
            flex: 1;
        }

        .menu-group {
            margin-bottom: 20px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            overflow: hidden;
        }

        .menu-title {
            padding: 14px 20px;
            display: flex;
            align-items: center;
            gap: 15px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .menu-title:hover {
            background: rgba(255, 255, 255, 0.12);
        }

        .menu-title.active {
            background: rgba(255, 255, 255, 0.15);
        }

        .menu-title i {
            font-size: 18px;
            width: 24px;
            text-align: center;
        }

        .menu-text {
            font-size: 15px;
            flex: 1;
        }

        .menu-title .arrow {
            font-size: 14px;
            transition: transform 0.3s ease;
        }

        .menu-title.active .arrow {
            transform: rotate(180deg);
        }

        .submenu {
            background: rgba(0, 0, 0, 0.15);
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.35s cubic-bezier(.4,0,.2,1);
        }

        .submenu.open {
            max-height: 500px;
        }

        .submenu-item {
            padding: 12px 20px 12px 55px;
            font-size: 14px;
            cursor: pointer;
            color: #fff;
            transition: background 0.2s, color 0.2s;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .submenu-item:hover {
            background: rgba(255, 255, 255, 0.18);
        }

        .submenu-item.active {
            background: rgba(255, 255, 255, 0.25);
            color: #ffcc00;
            font-weight: 500;
        }

        .submenu-item i {
            font-size: 12px;
            opacity: 0.8;
        }

        .logout-btn {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 14px 20px;
            cursor: pointer;
            transition: all 0.2s;
            border-radius: 8px;
            margin: 10px 15px 0;
            color: #fff;
            background: rgba(231, 76, 60, 0.2);
            border: none;
            font-size: 15px;
            width: calc(100% - 30px);
        }

        .logout-btn:hover {
            background: rgba(231, 76, 60, 0.3);
        }

        /* 右侧内容区样式 */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: auto;
        }

        .topbar {
            background-color: white;
            padding: 0 30px;
            height: 80px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            border-bottom: 1px solid #eee;
            flex-shrink: 0;
            z-index: 10;
        }

        .page-title {
            font-size: 24px;
            font-weight: 600;
            color: #1a3a6c;
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .page-title i {
            background-color: #1a3a6c;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }

        .welcome {
            font-size: 18px;
            font-weight: 500;
            color: #444;
        }

        .user-name {
            color: #1a3a6c;
            font-weight: 600;
        }

        .iframe-container {
            background: white;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            flex: 1;
            overflow: hidden;
            display: flex;
        }

        iframe {
            width: 100%;
            height: 100%;
            border: none;
            background: #f5f7fa;
        }

        /* 响应式设计 */
        @media (max-width: 900px) {
            .app-container {
                flex-direction: column;
            }

            .sidebar {
                width: 100%;
                padding: 15px 0;
            }

            .logo-container {
                padding: 0 15px 15px;
            }

            .user-info {
                padding: 15px;
            }

            .menu-title {
                padding: 12px 15px;
            }

            .submenu-item {
                padding-left: 45px;
            }
        }

        @media (max-width: 768px) {
            .topbar {
                padding: 0 20px;
                height: 70px;
            }

            .page-title {
                font-size: 20px;
            }

        }

        @media (max-width: 576px) {
            .topbar {
                flex-direction: column;
                height: auto;
                padding: 15px;
            }

            .page-title {
                margin-bottom: 10px;
            }
        }
    </style>
</head>
<body>
    <div class="app-container">
        <!-- 左侧菜单 -->
        <div class="sidebar">
            <div class="logo-container">
                <div class="logo">
                    <div class="logo-icon">
                        <i class="fas fa-user-shield"></i>
                    </div>
                    <div class="logo-text">银行管理后台</div>
                </div>
            </div>

            <div class="user-info">
                <div class="avatar" id="admin-avatar">A</div>
                <div class="user-details">
                    <div class="user-name" id="admin-name"></div>
                    <div class="user-role">系统管理员</div>
                </div>
            </div>

            <div class="sidebar-menu">
                <!-- 客户管理 -->
                <div class="menu-group">
                    <div class="menu-title" data-group="user">
                        <i class="fas fa-users"></i>
                        <div class="menu-text">客户管理</div>
                        <i class="fas fa-angle-down arrow"></i>
                    </div>
                    <div class="submenu" id="submenu-user">
                        <div class="submenu-item" data-url="admin_user/signup.html">
                            <i class="fas fa-user-plus"></i>客户注册
                        </div>
                        <div class="submenu-item" data-url="admin_user/delete.html">
                            <i class="fas fa-user-minus"></i>客户删除
                        </div>
                        <div class="submenu-item" data-url="admin_user/update.html">
                            <i class="fas fa-user-edit"></i>客户信息更新
                        </div>
                        <div class="submenu-item" data-url="admin_user/list.html">
                            <i class="fas fa-list"></i>客户列表查询
                        </div>
                        <div class="submenu-item" data-url="admin_user/csv.html">
                            <i class="fas fa-file-export"></i>客户列表导出
                        </div>
                    </div>
                </div>

                <!-- 银行卡管理 -->
                <div class="menu-group">
                    <div class="menu-title" data-group="card">
                        <i class="fas fa-credit-card"></i>
                        <div class="menu-text">银行卡管理</div>
                        <i class="fas fa-angle-down arrow"></i>
                    </div>
                    <div class="submenu" id="submenu-card">
                        <div class="submenu-item" data-url="admin_card/signup.html">
                            <i class="fas fa-plus-circle"></i>银行卡注册
                        </div>
                        <div class="submenu-item" data-url="admin_card/delete.html">
                            <i class="fas fa-minus-circle"></i>银行卡删除
                        </div>
                        <div class="submenu-item" data-url="admin_card/update.html">
                            <i class="fas fa-edit"></i>银行卡信息更新
                        </div>
                        <div class="submenu-item" data-url="admin_card/list.html">
                            <i class="fas fa-list"></i>银行卡列表查询
                        </div>
                        <div class="submenu-item" data-url="admin_card/csv.html">
                            <i class="fas fa-file-export"></i>银行卡列表导出
                        </div>
                    </div>
                </div>

                <!-- 交易管理 -->
                <div class="menu-group">
                    <div class="menu-title" data-group="trade">
                        <i class="fas fa-exchange-alt"></i>
                        <div class="menu-text">交易管理</div>
                        <i class="fas fa-angle-down arrow"></i>
                    </div>
                    <div class="submenu" id="submenu-trade">
                        <div class="submenu-item" data-url="admin_trade/list.html">
                            <i class="fas fa-list"></i>交易列表查询
                        </div>
                        <div class="submenu-item" data-url="admin_trade/csv.html">
                            <i class="fas fa-file-export"></i>交易列表导出
                        </div>
                    </div>
                </div>

                <!-- 存款管理 -->
                <div class="menu-group">
                    <div class="menu-title" data-group="deposit">
                        <i class="fas fa-piggy-bank"></i>
                        <div class="menu-text">存款管理</div>
                        <i class="fas fa-angle-down arrow"></i>
                    </div>
                    <div class="submenu" id="submenu-deposit">
                        <div class="submenu-item" data-url="admin_deposit/add.html">
                            <i class="fas fa-plus-circle"></i>存款添加
                        </div>
                        <div class="submenu-item" data-url="admin_deposit/update.html">
                            <i class="fas fa-edit"></i>存款信息更新
                        </div>
                        <div class="submenu-item" data-url="admin_deposit/delete.html">
                            <i class="fas fa-minus-circle"></i>存款删除
                        </div>
                        <div class="submenu-item" data-url="admin_deposit/list.html">
                            <i class="fas fa-list"></i>存款列表查询
                        </div>
                        <div class="submenu-item" data-url="admin_deposit/csv.html">
                            <i class="fas fa-file-export"></i>存款列表导出
                        </div>
                    </div>
                </div>

                <button class="logout-btn" onclick="logout()">
                    <i class="fas fa-sign-out-alt"></i> 退出登录
                </button>
            </div>
        </div>

        <!-- 右侧内容区 -->
        <div class="main-content">
            <div class="topbar">
                <div class="page-title">
                    <i class="fas fa-chart-line"></i>
                    <span>管理控制台</span>
                </div>
                <div class="welcome">欢迎管理员！</div>
            </div>


                <!-- 内容区域 -->
                <div class="iframe-container">
                    <iframe id="main-iframe" src="" frameborder="0"></iframe>
                </div>
            </div>
        </div>
    </div>

    <script>


        // 展开/折叠菜单，带动画
        const menuTitles = document.querySelectorAll('.menu-title');
        menuTitles.forEach(title => {
            title.addEventListener('click', function() {
                const group = this.getAttribute('data-group');
                const submenu = document.getElementById('submenu-' + group);
                const arrow = this.querySelector('.arrow');

                // 关闭其他所有菜单
                document.querySelectorAll('.submenu').forEach(sub => {
                    if(sub !== submenu) {
                        sub.classList.remove('open');
                        const otherTitle = sub.closest('.menu-group').querySelector('.menu-title');
                        otherTitle.classList.remove('active');
                    }
                });

                // 切换当前菜单状态
                this.classList.toggle('active');
                submenu.classList.toggle('open');
            });
        });

        // 二级菜单点击加载iframe
        const submenuItems = document.querySelectorAll('.submenu-item');
        submenuItems.forEach(item => {
            item.addEventListener('click', function() {
                submenuItems.forEach(i => i.classList.remove('active'));
                this.classList.add('active');

                const url = this.getAttribute('data-url');
                document.getElementById('main-iframe').src = url;

                // 更新页面标题为选中的菜单项
                const pageTitle = document.querySelector('.page-title span');
                const menuText = this.textContent.trim();
                pageTitle.textContent = menuText;
            });
        });

        // 默认展开第一个菜单
        window.onload = function() {
            document.querySelector('.menu-title').click();
        };

        // 退出登录
        function logout() {
            if(confirm('确定要退出系统吗？')) {
                sessionStorage.removeItem('admin');
                window.location.href = 'login.html';
            }
        }
    </script>
</body>
</html>